Skip to content

test(e2e): Port the nestjs-bullmq E2E app to span streaming - #24107

Open
chargome wants to merge 1 commit into
developfrom
cg/e2e-nestjs-bullmq-streaming
Open

test(e2e): Port the nestjs-bullmq E2E app to span streaming#24107
chargome wants to merge 1 commit into
developfrom
cg/e2e-nestjs-bullmq-streaming

Conversation

@chargome

@chargome chargome commented Sep 4, 2026

Copy link
Copy Markdown
Member

Removes the traceLifecycle: 'static' pin and rewrites the specs against streamed spans.

The queue span is named process test-queue under span streaming, the other way around from the transaction name. Streamed spans carry no breadcrumbs, so /check-isolation reports which of the processor's breadcrumbs leaked into its isolation scope as a span attribute.

Ref: #23801

🤖 Generated with Claude Code

Removes the `traceLifecycle: 'static'` pin and rewrites the specs against streamed spans.

The queue span is named `process test-queue` under span streaming, the other way around from the transaction name. Streamed spans carry no breadcrumbs, so `/check-isolation` reports which of the processor's breadcrumbs leaked into its isolation scope as a span attribute.

Ref: #23801

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chargome chargome self-assigned this Sep 4, 2026
@chargome

chargome commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

bugbot run

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.7 kB - -
@sentry/browser - with treeshaking flags 27.01 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.9 kB - -
@sentry/browser (incl. Tracing) 49.08 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.08 kB - -
@sentry/browser (incl. Tracing, Profiling) 52 kB - -
@sentry/browser (incl. Tracing, Replay) 88.63 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.31 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.26 kB - -
@sentry/browser (incl. Feedback) 46.19 kB - -
@sentry/browser (incl. sendFeedback) 33.76 kB - -
@sentry/browser (incl. FeedbackAsync) 38.86 kB - -
@sentry/browser (incl. Metrics) 29.67 kB - -
@sentry/browser (incl. Logs) 29.95 kB - -
@sentry/browser (incl. Metrics & Logs) 30.6 kB - -
@sentry/react 30.46 kB - -
@sentry/react (incl. Tracing) 51.29 kB - -
@sentry/vue 35.93 kB - -
@sentry/vue (incl. Tracing) 51.35 kB - -
@sentry/svelte 28.72 kB - -
CDN Bundle 30.44 kB - -
CDN Bundle (incl. Tracing) 49.61 kB - -
CDN Bundle (incl. Logs, Metrics) 32.67 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.54 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.33 kB - -
CDN Bundle (incl. Tracing, Replay) 87.17 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.03 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.1 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.04 kB - -
CDN Bundle - uncompressed 90.17 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.84 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.55 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.62 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.86 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.48 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.18 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.94 kB - -
@sentry/nextjs (client) 53.9 kB - -
@sentry/sveltekit (client) 49.52 kB - -
@sentry/core/server 40.97 kB - -
@sentry/core/browser 13.53 kB - -
@sentry/node 124.81 kB +0.02% +19 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB - -
@sentry/node - without tracing 88.51 kB +0.03% +22 B 🔺
@sentry/node - without channel injection 104.12 kB +0.02% +19 B 🔺
@sentry/aws-serverless 96.88 kB +0.02% +17 B 🔺
@sentry/cloudflare (withSentry) - minified 201.59 kB - -
@sentry/cloudflare (withSentry) 501.43 kB - -

View base workflow run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 829a5a0. Configure here.

@chargome
chargome marked this pull request as ready for review September 7, 2026 12:25
@chargome
chargome requested a review from nicohrubec September 7, 2026 12:25

await fetch(`${baseURL}/check-isolation`);

return (await segmentSpanPromise).attributes['isolation_scope.leaked_breadcrumbs']?.value;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The test can crash with a TypeError if the isolation_scope.leaked_breadcrumbs attribute is undefined, as .toContain() cannot be called on it.
Severity: LOW

Suggested Fix

Before the assertion, ensure the isolation_scope.leaked_breadcrumbs attribute is an array. You can default the value to an empty array if it's undefined to prevent the crash, for example: expect(breadcrumbs ?? []).not.toContain(...).

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
dev-packages/e2e-tests/test-applications/nestjs-bullmq/tests/bullmq.test.ts#L21

Potential issue: The e2e test for `/check-isolation` is fragile and can crash. If
`getActiveSpan()` returns `null` during the request, the
`isolation_scope.leaked_breadcrumbs` attribute is not set on the span. The test code
then accesses this attribute, which evaluates to `undefined`. The subsequent assertion,
`expect(undefined).not.toContain(...)`, throws a `TypeError` because the matcher expects
a string or an array. This causes the test runner to crash instead of reporting a clear
assertion failure.

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant